package com.yvan.periscope.stat;

import java.io.Serializable;

/**
 * 监控 JVM 状态数据
 */
public final class JvmStat implements Serializable {

    // Thread
    private int threadCount = -1;
    private int threadDeadlocks = -1;
    private int threadBlockedCount = -1;

    // GC - sum
    private long psScavengeCountSum = -1;
    private long psScavengeTimeSum = -1;

    private long psMarkSweepCountSum = -1;
    private long psMarkSweepTimeSum = -1;

    // GC - increment 一个时间段的增量
    private long psScavengeCount = -1;
    private long psScavengeTime = -1;

    private long psMarkSweepCount = -1;
    private long psMarkSweepTime = -1;

    // Memory
    private long memoryTotalUsed = -1;
    private long memoryTotalMax = -1;

    private long memoryHeapUsed = -1;
    private long memoryHeapMax = -1;

    private long memoryNonHeapUsed = -1;
    private long memoryNonHeapMax = -1;

    private long memoryPoolsPsEdenSpaceMax = -1;
    private long memoryPoolsPsEdenSpaceUsed = -1;

    private long memoryPoolsPsOldGenMax = -1;
    private long memoryPoolsPsOldGenUsed = -1;

    public int getThreadCount() {
        return threadCount;
    }

    public void setThreadCount(int threadCount) {
        this.threadCount = threadCount;
    }

    public int getThreadDeadlocks() {
        return threadDeadlocks;
    }

    public void setThreadDeadlocks(int threadDeadlocks) {
        this.threadDeadlocks = threadDeadlocks;
    }

    public int getThreadBlockedCount() {
        return threadBlockedCount;
    }

    public void setThreadBlockedCount(int threadBlockedCount) {
        this.threadBlockedCount = threadBlockedCount;
    }

    public long getPsScavengeCountSum() {
        return psScavengeCountSum;
    }

    public void setPsScavengeCountSum(long psScavengeCountSum) {
        this.psScavengeCountSum = psScavengeCountSum;
    }

    public long getPsScavengeTimeSum() {
        return psScavengeTimeSum;
    }

    public void setPsScavengeTimeSum(long psScavengeTimeSum) {
        this.psScavengeTimeSum = psScavengeTimeSum;
    }

    public long getPsMarkSweepCountSum() {
        return psMarkSweepCountSum;
    }

    public void setPsMarkSweepCountSum(long psMarkSweepCountSum) {
        this.psMarkSweepCountSum = psMarkSweepCountSum;
    }

    public long getPsMarkSweepTimeSum() {
        return psMarkSweepTimeSum;
    }

    public void setPsMarkSweepTimeSum(long psMarkSweepTimeSum) {
        this.psMarkSweepTimeSum = psMarkSweepTimeSum;
    }

    public long getPsScavengeCount() {
        return psScavengeCount;
    }

    public void setPsScavengeCount(long psScavengeCount) {
        this.psScavengeCount = psScavengeCount;
    }

    public long getPsScavengeTime() {
        return psScavengeTime;
    }

    public void setPsScavengeTime(long psScavengeTime) {
        this.psScavengeTime = psScavengeTime;
    }

    public long getPsMarkSweepCount() {
        return psMarkSweepCount;
    }

    public void setPsMarkSweepCount(long psMarkSweepCount) {
        this.psMarkSweepCount = psMarkSweepCount;
    }

    public long getPsMarkSweepTime() {
        return psMarkSweepTime;
    }

    public void setPsMarkSweepTime(long psMarkSweepTime) {
        this.psMarkSweepTime = psMarkSweepTime;
    }

    public long getMemoryTotalUsed() {
        return memoryTotalUsed;
    }

    public void setMemoryTotalUsed(long memoryTotalUsed) {
        this.memoryTotalUsed = memoryTotalUsed;
    }

    public long getMemoryTotalMax() {
        return memoryTotalMax;
    }

    public void setMemoryTotalMax(long memoryTotalMax) {
        this.memoryTotalMax = memoryTotalMax;
    }

    public long getMemoryHeapUsed() {
        return memoryHeapUsed;
    }

    public void setMemoryHeapUsed(long memoryHeapUsed) {
        this.memoryHeapUsed = memoryHeapUsed;
    }

    public long getMemoryHeapMax() {
        return memoryHeapMax;
    }

    public void setMemoryHeapMax(long memoryHeapMax) {
        this.memoryHeapMax = memoryHeapMax;
    }

    public long getMemoryNonHeapUsed() {
        return memoryNonHeapUsed;
    }

    public void setMemoryNonHeapUsed(long memoryNonHeapUsed) {
        this.memoryNonHeapUsed = memoryNonHeapUsed;
    }

    public long getMemoryNonHeapMax() {
        return memoryNonHeapMax;
    }

    public void setMemoryNonHeapMax(long memoryNonHeapMax) {
        this.memoryNonHeapMax = memoryNonHeapMax;
    }

    public long getMemoryPoolsPsEdenSpaceMax() {
        return memoryPoolsPsEdenSpaceMax;
    }

    public void setMemoryPoolsPsEdenSpaceMax(long memoryPoolsPsEdenSpaceMax) {
        this.memoryPoolsPsEdenSpaceMax = memoryPoolsPsEdenSpaceMax;
    }

    public long getMemoryPoolsPsEdenSpaceUsed() {
        return memoryPoolsPsEdenSpaceUsed;
    }

    public void setMemoryPoolsPsEdenSpaceUsed(long memoryPoolsPsEdenSpaceUsed) {
        this.memoryPoolsPsEdenSpaceUsed = memoryPoolsPsEdenSpaceUsed;
    }

    public long getMemoryPoolsPsOldGenMax() {
        return memoryPoolsPsOldGenMax;
    }

    public void setMemoryPoolsPsOldGenMax(long memoryPoolsPsOldGenMax) {
        this.memoryPoolsPsOldGenMax = memoryPoolsPsOldGenMax;
    }

    public long getMemoryPoolsPsOldGenUsed() {
        return memoryPoolsPsOldGenUsed;
    }

    public void setMemoryPoolsPsOldGenUsed(long memoryPoolsPsOldGenUsed) {
        this.memoryPoolsPsOldGenUsed = memoryPoolsPsOldGenUsed;
    }

    @Override
    public String toString() {
        return "JvmStat{" +
                "threadCount=" + threadCount +
                ", threadDeadlocks=" + threadDeadlocks +
                ", threadBlockedCount=" + threadBlockedCount +
                ", psScavengeCountSum=" + psScavengeCountSum +
                ", psScavengeTimeSum=" + psScavengeTimeSum +
                ", psMarkSweepCountSum=" + psMarkSweepCountSum +
                ", psMarkSweepTimeSum=" + psMarkSweepTimeSum +
                ", memoryTotalUsed=" + memoryTotalUsed +
                ", memoryTotalMax=" + memoryTotalMax +
                ", memoryHeapUsed=" + memoryHeapUsed +
                ", memoryHeapMax=" + memoryHeapMax +
                ", memoryNonHeapUsed=" + memoryNonHeapUsed +
                ", memoryNonHeapMax=" + memoryNonHeapMax +
                ", memoryPoolsPsEdenSpaceMax=" + memoryPoolsPsEdenSpaceMax +
                ", memoryPoolsPsEdenSpaceUsed=" + memoryPoolsPsEdenSpaceUsed +
                ", memoryPoolsPsOldGenMax=" + memoryPoolsPsOldGenMax +
                ", memoryPoolsPsOldGenUsed=" + memoryPoolsPsOldGenUsed +
                '}';
    }
}
